#pragma once
#ifndef GAME_H
#define GAME_H

#include <list>

#include "GameBase.h"

#define BUILDINGS_COUNT		(8)
#define PLAYER_PEICES		(2)
#define PLAYER_SPEEDMULT	(2)
#define PLAYER_MAXDAMAGE	(1.5)
#define MAX_BULLETS			(3)

class Game : public GameBase {
	private:
		AWSprite game_ground;
		AWSprite game_buildings[BUILDINGS_COUNT];
		AWSprite game_player[PLAYER_PEICES];
		AWSprite game_bullets[MAX_BULLETS];

		list<AWSprite*> game_bullets_can_fire;
		list<AWSprite*> game_missiles;

		AWSprite game_health;

		float spawn_next, time_paused, spawn_delay, game_player_damage;

		int alive_buildings;
		int score;
	public:
		Game();
		~Game();

		void setup();
		void logic();
		void draw();

		AWSprite * Game::CreateMissile();

		void FireBullet();
		void HitBuilding(int i);
		
		void DamagePlayer(float dmg);
		void HealPlayer(float heal);
		void MovePlayer();
		void ThinkPlayer();
		void ThinkBullets();
		void ThinkMissiles();

		void onKeyReleased();
		void onKeyPressed();
};

#endif